package com.ruoyi.building.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 楼宇管理对象 am_building
 * 
 * @author ruoyi
 * @date 2020-07-29
 */
public class AmBuilding extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 楼宇表ID */
    private Long id;

    /** 楼宇编号 */
    private String buildingCode;

    /** 招商部id*/
    private Long deptId;
    /** 楼宇名称 */
    @Excel(name = "楼宇名称")
    private String buildingName;

    /** 开始楼层 */
    @Excel(name = "开始楼层")
    private Long floorStart;

    /** 结束楼层 */
    @Excel(name = "结束楼层")
    private Long floorEnd;

    /** 所属项目 */
    private Long projectId;


    /** 所属项目*/
	@Excel(name = "所属项目")
    private String projectName;

    /** 删除:1正常0删除 */
    private Long del;

    /** 最后修改时间 */
    private Date modifiedTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public void setBuildingCode(String buildingCode)
    {
        this.buildingCode = buildingCode;
    }

    public String getBuildingCode() 
    {
        return buildingCode;
    }
    public void setBuildingName(String buildingName) 
    {
        this.buildingName = buildingName;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getBuildingName()
    {
        return buildingName;
    }
    public void setFloorStart(Long floorStart) 
    {
        this.floorStart = floorStart;
    }

    public Long getFloorStart() 
    {
        return floorStart;
    }
    public void setFloorEnd(Long floorEnd) 
    {
        this.floorEnd = floorEnd;
    }

    public Long getFloorEnd() 
    {
        return floorEnd;
    }
    public void setProjectId(Long projectId) 
    {
        this.projectId = projectId;
    }

    public Long getProjectId() 
    {
        return projectId;
    }
    public void setDel(Long del) 
    {
        this.del = del;
    }

    public Long getDel() 
    {
        return del;
    }
    public void setModifiedTime(Date modifiedTime) 
    {
        this.modifiedTime = modifiedTime;
    }

    public Date getModifiedTime() 
    {
        return modifiedTime;
    }

    public static  Long castIdByBuildingName(List<AmBuilding> list , String buildingName ,String projectName){
        if (null == buildingName){
            return null;
        }
        if (null == projectName){
            return null;
        }
        if (null == list || list.size() == 0 ){
            return null;
        }
        for (AmBuilding amBuilding : list) {
            if (amBuilding.getBuildingName().equals(buildingName) && amBuilding.getProjectName().equals(projectName) ){
                return amBuilding.getId();
            }
        }
        return null;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("buildingCode", getBuildingCode())
            .append("buildingName", getBuildingName())
            .append("floorStart", getFloorStart())
            .append("floorEnd", getFloorEnd())
            .append("projectId", getProjectId())
            .append("del", getDel())
            .append("createTime", getCreateTime())
            .append("modifiedTime", getModifiedTime())
            .toString();
    }
}
